package org.example.leetCode;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

/**
 * @Author Qinkai
 * @Description TODO $
 * @Date $ 2021-0916$
 * @Param $
 * @return $
 **/
public class IsUnique {
    public boolean isUnique(String astr) {
        char[] chars = astr.toCharArray();
        Set<Character> set = new HashSet<>();
        for (char aChar : chars) {
            if (!set.add(aChar)) {
                return false;
            }
        }
        return true;
    }
}
